package com.oop.ch03;


/**
 * 定义一个宠物类
 * @author Administrator
 */
public class Pet {
	//昵称
	private String name;
	//性别
	private String sex;
	//年龄
	private int age;
	//血统
	private String type;
	//体重
	private double weight;
	//肤色
	private String color;
	

	public Pet(){}
	
	//父类的构造方法
	public Pet(String name, String sex, int age, String type, double weight) {
		this.name = name;
		this.sex = sex;
		this.age = age;
		this.type = type;
		this.weight = weight;
	}
	
	//自我介绍的方法
	//主人你好，我是可爱的旺财，今年2岁了，我是一只雌性的哈士奇，体重10.3公斤
	public void print(){
		System.out.println("主人你好，我是可爱的"+this.getName()+"，今年"+age+"岁了，我是一只"+sex+"的"+type+"，体重"+weight+"公斤");
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getSex() {
		return sex;
	}
	
	public void setSex(String sex) {
		this.sex = sex;
	}
	
	public int getAge() {
		return age;
	}
	
	public void setAge(int age) {
		this.age = age;
	}
	
	public String getType() {
		return type;
	}
	
	public void setType(String type) {
		this.type = type;
	}
	
	public double getWeight() {
		return weight;
	}
	
	public void setWeight(double weight) {
		this.weight = weight;
	}
	
	public String getColor() {
		return color;
	}
	
	public void setColor(String color) {
		this.color = color;
	}
}
